package com.zy.cloud.service;

import com.zy.cloud.entity.CommonResult;
import com.zy.cloud.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Component
@FeignClient(value = "CLOUD-PROVIDER-SERVER")
public interface UserFeignService {

    @GetMapping("/user/{id}")
    CommonResult<User> selectOne(@PathVariable("id") Long id);

    /**
     * 测试  服务提供方主动等待时间，是否能够正常请求
     * @return
     */
    @GetMapping("/user/feign/timeout")
    String getServerPort();
}
